package com.tools.service.impl;

import com.tools.model.entity.InfoEntity;
import com.tools.repository.InfoRepository;
import com.tools.service.InfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * @author wangminggen
 */
@Service
@RequiredArgsConstructor
public class InfoServiceImpl implements InfoService {
    private final InfoRepository infoRepository;

    @Override
    public void save(InfoEntity infoEntity) {
        infoRepository.save(infoEntity);
    }

    @Override
    public InfoEntity findByUserId(String userId) {
        return infoRepository.findAllByUserId(userId);
    }

}
